package com.hsmw.api.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hsmw.api.mapper.HsmwGoodsOrderMapper;
import com.hsmw.common.base.BaseService;
import com.hsmw.domain.HsmwGoodsOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Slf4j
@Service
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class HsmwGoodsOrderService extends BaseService<HsmwGoodsOrderMapper, HsmwGoodsOrder> {


    @Autowired
    private HsmwGoodsOrderMapper hsmwGoodsOrderMapper;

    public List<HsmwGoodsOrder> findGoodsOrderListByDriId(String id) {


        List<HsmwGoodsOrder> hsmwGoodsOrders = hsmwGoodsOrderMapper.selectList(new LambdaQueryWrapper<HsmwGoodsOrder>().eq(HsmwGoodsOrder::getDriverId, id));

        return hsmwGoodsOrders;
    }
}
